1. Field of the Invention
The present invention relates generally to optical mice, and more particularly to a method for processing image data of an optical mouse, which obtains an improved trajectory curve of a pointer of the optical mouse.
2. Description of the Prior Art
FIG. 1 is a block diagram of an image processing circuit of a conventional optical mouse.
The optical mouse image processing circuit 5 comprises an image pixel array 1, an analog circuit for controlling the image pixel array 1, an analog/digital converter 2, a motion vector (motion or movement coordinates of the optical mouse) calculating unit 3, and a personal computer (PC) interface 4 for interfacing with a PC 6.
The image-pixel array 1 extracts values, obtained by the reactions of the pixels when the pixels react to light according to the movement of the mouse, from the pixels. In this case, an image pixel array consisting of 18*18 (324) pixels each with a size of 53 μm*53 μm is used as an example of the image pixel array 1.
Values outputted from the image pixel array 1 are analog values, so a process of converting the analog values into digital values using the analog/digital converter 2 is required. In this case, pixel data corresponding to 18*18 pixels of the image pixel array 1 are not simultaneously inputted to the analog/digital converter 2, but sequentially inputted thereto one by one and then converted from analog to digital values. The converted digital values for respective pixels can be represented by 4-bit or 8-bit data according to the resolution of the analog/digital converter 2.
The motion vector calculating unit 3 is used to calculate motion vectors. A process of calculating the motion vectors is described. First, 11*11 image data of 18*18 pixel image data are used as a reference frame. In this case, 18*18 image data of a previous frame are stored in a buffer. If a next frame is inputted to the buffer, 11*11 image data of the next frame are compared with the 11*11 image data of the previous frame while the 11*11 image data of the next frame move, thereby calculating motion vectors. At this time, through a process of reducing each of the 18*18 image data of the previous frame stored in the buffer into 1-bit data, 17*17 image data remain. If the 11*11 image data of the next frame is compared with 11*11 image data of the reference frame, the displacement of a difference therebetween is within a range of −3 to 3 for a reference time interval, and the value of each of motion vectors is one of −3, −2, −1, 0, 1, 2 and 3.
The motion vector values determined by the above process are read every set time, and are enumerated continuously, thus determining a trajectory of the optical mouse. In this case, only if a difference between consecutive values varies rapidly, a motion vector is recognized as an error and adjusted to a correct value. Therefore, if data whose directions vary are temporarily inputted, the motion vectors cannot be effectively adjusted, so the trajectory of the optical mouse is unnaturally represented on a monitor in many cases. For example, if motion vector values are inputted as 030, “0” represents a motionless state of the mouse, and “3” represents a sudden motion thereof. However, a sudden motion cannot occur for a short time interval, so “3” is recognized as an error and is compulsorily adjusted to “0” to improve the movement of the mouse. However, if it is determined that the mouse moves left and motion vectors are mistakenly calculated even though the mouse actually moves right (positive direction), for example, if motion vector values are “0 (−1) 0”, the motion vectors cannot be recognized as errors because the motion vector values do not represent a sudden variation. Therefore, in many cases, the trajectory of the mouse becomes unnatural. Such data errors are generated due to the imprecision of analog processing at a part of the optical mouse which reads data. These data errors can be clearly seen by referring to a trajectory of a mouse pointer, obtained when a rectangle is drawn by the optical mouse in FIG. 2a, and a trajectory of the mouse pointer, obtained when a circle is drawn by the optical mouse in FIG. 2b. 